﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Details.aspx.vb" Inherits="TeachersWorkSheets.Details" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
        }
        .style5
        {
            width: 139px;
        }
        .style6
        {
        }
        .style7
        {
            font-family: "Segoe UI Semibold";
            font-size: medium;
            color: #000000;
        }
        .style8
        {
            width: 565px;
            font-family: "Segoe UI";
            font-size: small;
            color: #000000;
        }
        .style14
        {
            font-family: "Segoe UI Semibold";
            font-size: medium;
            color: #000000;
        }
        .style15
        {
            width: 565px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <table class="style1" width="50">
            <tr>
                <td class="style2" align="center" colspan="6">
                    <asp:SqlDataSource ID="SheetDetailsSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SheetsConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:SheetsConnectionString.ProviderName %>" 
                        SelectCommand="SELECT [ID], [ShtName], [ShtFile], [ShtCreator], [ShtDescription], [ShtRate], [ShtSubject], [ShtGrade], [ShtRegDate], [ShtViewers] FROM [ActivitySheet] WHERE ([ID] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                        CellPadding="4" DataKeyNames="ID" DataSourceID="SheetDetailsSource" 
                        ForeColor="#333333" GridLines="None" Height="50px" Width="125px" 
                        style="margin-left: 0px">
                        <AlternatingRowStyle BackColor="White" />
                        <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
                        <EditRowStyle BackColor="#2461BF" />
                        <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
                        <Fields>
                            <asp:BoundField DataField="ShtName" HeaderText="Title" SortExpression="ShtName">
                            <ItemStyle Font-Bold="True" Font-Size="Medium" HorizontalAlign="Center" 
                                VerticalAlign="Middle" />
                            </asp:BoundField>
                            <asp:ImageField DataImageUrlField="ShtFile">
                                <ControlStyle CssClass="sheetDetailsSize" />
                                <ItemStyle CssClass="sheetSize" />
                            </asp:ImageField>
                            <asp:BoundField DataField="ShtSubject" HeaderText="Subject" 
                                SortExpression="ShtSubject" />
                            <asp:BoundField DataField="ShtDescription" HeaderText="Description" 
                                SortExpression="ShtDescription" />
                            <asp:BoundField DataField="ShtCreator" HeaderText="Author" 
                                SortExpression="ShtCreator" />
                            <asp:BoundField DataField="ShtGrade" HeaderText="Grade" 
                                SortExpression="ShtGrade" />
                            <asp:BoundField DataField="ShtRate" HeaderText="Rate" 
                                SortExpression="ShtRate" />
                            <asp:BoundField DataField="ShtRegDate" HeaderText="Date" 
                                SortExpression="ShtRegDate" />
                            <asp:BoundField DataField="ShtViewers" HeaderText="Viewers" 
                                SortExpression="ShtViewers" />
                        </Fields>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
                            BorderStyle="Solid" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                    </asp:DetailsView>
                    </td>
            </tr>
            <tr>
                <td class="style6" align="center" colspan="4">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15" align="center">
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SheetsConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:SheetsConnectionString.ProviderName %>" 
                        
                        SelectCommand="SELECT Author, Title, Sheet_fkID, CommentBody, RegDate FROM Comments WHERE (Sheet_fkID = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="Sheet_fkID" QueryStringField="ID" 
                                Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td class="style6" colspan="2">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" 
                        GridLines="None" style="margin-left: 0px" Width="406px">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:BoundField DataField="Author" HeaderText="Author" 
                                SortExpression="Author" />
                            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                            <asp:BoundField DataField="Sheet_fkID" HeaderText="Sheet_fkID" 
                                SortExpression="Sheet_fkID" />
                            <asp:BoundField DataField="CommentBody" HeaderText="CommentBody" 
                                SortExpression="CommentBody" />
                            <asp:BoundField DataField="RegDate" HeaderText="RegDate" 
                                SortExpression="RegDate" />
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                </td>
                <td class="style6" align="center">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15" align="right">
                    <span class="style7">Title</span> :
                </td>
                <td class="style6" colspan="2">
                    <asp:TextBox ID="tb_CommTitle" runat="server" BorderColor="#006699"></asp:TextBox>
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    <asp:TextBox ID="tb_commBody" runat="server" Height="161px" 
                        TextMode="MultiLine" Width="507px" BorderColor="#006699" 
                        BorderStyle="Solid"></asp:TextBox>
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    <asp:Button ID="btn_AddComm" runat="server" Text="Add Comment" />
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style6" align="center" colspan="4">
                    <asp:CheckBoxList ID="cb_Tags" runat="server" DataSourceID="SqlDataSource3" 
                        DataTextField="Tags" DataValueField="ID" RepeatDirection="Horizontal" 
                        style="color: #000000; font-size: small; font-family: 'Segoe UI Symbol'">
                    </asp:CheckBoxList>
                </td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15" align="right">
                    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SheetsConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:SheetsConnectionString.ProviderName %>" 
                        SelectCommand="SELECT [ID], [Tags] FROM [Tags]"></asp:SqlDataSource>
                </td>
                <td class="style6" colspan="2">
                    <asp:Button ID="btn_AddTagToDb" runat="server" Text="Tag This Sheet" />
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style15" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" align="right">
                    Add New Tag</td>
                <td class="style6" colspan="2">
                    <asp:TextBox ID="tb_AddNewTag" runat="server"></asp:TextBox>
                    <asp:Button ID="btn_AddNewTag" runat="server" Text="Add Tag" />
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                <asp:SqlDataSource ID="likedatasource" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:SheetsConnectionString %>" 
                    InsertCommand="INSERT INTO usersheetLiking(Liker, sheetid) VALUES (?, ?)" 
                    ProviderName="<%$ ConnectionStrings:SheetsConnectionString.ProviderName %>" 
                    SelectCommand="SELECT [Author], [Title], [CommentBody], [Sheet_fkID] FROM [Comments] WHERE ([Sheet_fkID] = ?)" 
                    UpdateCommand="UPDATE ActivitySheet SET shtlike = shtlike + 1 WHERE (ID = ?)">
                    <InsertParameters>
                        <asp:SessionParameter Name="?" SessionField="username" />
                        <asp:QueryStringParameter Name="?" QueryStringField="id" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Sheet_fkID" QueryStringField="ID" 
                            Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:QueryStringParameter Name="?" QueryStringField="id" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    <asp:LinkButton ID="LinkButton1" runat="server" Width="49px" Font-Bold="True" 
                        Font-Size="Large">Like</asp:LinkButton>
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" align="right">
                    &nbsp;</td>
                <td class="style6">
                    <span class="style14">

                    <span class="style14">Rate this Activity Sheet:<asp:Rating ID="Rating1" 
                    runat="server" CurrentRating="2" EmptyStarCssClass="off-star" 
                    FilledStarCssClass="star" StarCssClass="star" WaitingStarCssClass="off-star">
                </asp:Rating><br />
                    </span></td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                <span class="style14">
                <asp:Button ID="btn_SaveRating" runat="server" Text="Save my Rating" />
                </span>
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" align="right">
                    &nbsp;</td>
                <td class="style6" colspan="2">
                    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                    </asp:ToolkitScriptManager>
                </td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style6" colspan="4">
                    <br />
                    <br />
                    <br />
                    <br />
                </td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
    </p>
</asp:Content>
